﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Linq.Expressions;
using TelerikedIn.Models;
using TelerikedIn.WebApp.ViewModels.Endorsments;

namespace TelerikedIn.WebApp.ViewModels.Skills
{
    public class SkillVM
    {
        [ScaffoldColumn(false)]
        public int Id { get; set; }

        [Required, StringLength(100)]
        public string Name { get; set; }

        public int EndorsmentsCount { get; set; }

        public static Expression<Func<Skill, SkillVM>> FromSkill
        {
            get
            {
                return s => new SkillVM 
                {
                    Id = s.Id,
                    Name = s.Name
                };
            }
        }       
    }
}